<?php $this->load->view('layout/header');?>
<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <h3 class="page-title">工程部<small>机器列表</small></h3>
            <?php echo breadcrumb(array('工程部', 'macs/grid'=>'机器列表', '推送订单')); ?>
        </div>
    </div>
    <?php echo execute_alert_message();?>
    <div class="row-fluid">
        <div class="span12">
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="icon-plus-sign"></i>推送订单</div>
                    <div class="tools">
                        <a class="collapse" href="javascript:;"></a>
                        <a class="remove" href="javascript:;"></a>
                    </div>
                </div>
                <div class="portlet-body form">
                    <form class="form-horizontal line-form" action="<?php echo base_url('macs/sendOk') ?>" method="post" enctype="multipart/form-data">
                        <div class="control-group">
                            <label class="control-label">景区编号</label>
                            <div class="controls">
                                <input type="text" name="sid" value="<?php echo $macs->sid;?>" class="m-wrap large required" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label">机器名称</label>
                            <div class="controls">
                                <input type="text" name="mac_name" value="<?php echo $macs->mac_name;?>" class="m-wrap large required" readonly="readonly"/>
                            </div>
                        </div>
                        <div class="control-group">
                            <label class="control-label"><em>* </em>订单编号</label>
                            <div class="controls">
                                <input type="hidden" name="mac_id" value="<?php echo $mac_id;?>"/>
                                <input type="text" name="order_id" class="m-wrap large required" />
                            </div>
                        </div>
                        <div class="form-actions">
                            <button class="btn green" type="submit"><i class="icon-ok"></i> 推送</button>
                            <a href="<?php echo base_url('macs/grid') ?>">
                                <button class="btn" type="button">返回</button>
                            </a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="icon-search"></i>搜索</div>
                    <div class="tools">
                        <a class="collapse" href="javascript:;"></a>
                        <a class="remove" href="javascript:;"></a>
                    </div>
                </div>
                <div class="portlet-body form">
                    <form class="form-horizontal form-search" action="<?php echo base_url('macs/orderSend/' . $macs->mac_id); ?>" method="get">
                        <div class="row-fluid">
                            <div class="span4">
                                <div class="control-group ">
                                    <label class="control-label">编号</label>
                                    <div class="controls">
                                        <input type="text" name="id" value="<?php echo $this->input->get('id');?>" class="" placeholder="请输入编号" >
                                    </div>
                                </div>
                            </div>
                            <div class="span4">
                                <div class="control-group">
                                    <label class="control-label">订单编号</label>
                                    <div class="controls">
                                        <input type="text" name="order_id" value="<?php echo $this->input->get('order_id');?>" class="" placeholder="请输入订单编号" >
                                    </div>
                                </div>
                            </div>
                            <div class="span3">
                                <div class="control-group">
                                    <label class="control-label">机器是否同步</label>
                                    <div class="controls">
                                        <select name="flag" class="m-wrap span12">
                                            <option value="-1">请选择</option>
                                            <option value="0" <?php echo $this->input->get('flag') == 0 ? 'selected' : ''?>>未同步</option>
                                            <option value="1" <?php echo $this->input->get('flag') == 1 ? 'selected' : ''?>>已同步</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-actions">
                            <button class="btn green" type="submit">搜索</button>
                            <button class="btn reset_button_search" type="button">重置条件</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12">
            <div class="portlet box green">
                <div class="portlet-title">
                    <div class="caption"><i class="icon-reorder"></i>列表</div>
                    <div class="tools">
                        <a class="collapse" href="javascript:;"></a>
                        <a class="remove" href="javascript:;"></a>
                    </div>
                </div>
                <div class="portlet-body flip-scroll">
                    <div class="dataTables_wrapper form-inline">
                        <?php if ($all_rows > 0) :?>
                        <table class="table table-striped table-bordered table-hover" id="sample_1">
                            <thead class="flip-content">
                                <tr>
                                    <th><input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes"></th>
                                    <th>编号</th>
                                    <th>机器编号</th>
                                    <th>订单编号</th>
                                    <th>机器是否同步</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach ($page_list->result() as $item) : ?>
                                <tr>
                                    <td width="15"><input type="checkbox" class="checkboxes" value="1" ></td>
                                    <td><?php echo $item->id;?></td>
                                    <td><?php echo $item->mac_id;?></td>
                                    <td><?php echo $item->order_id;?></td>
                                    <td><?php echo $item->flag == 1 ? '已同步' : '未同步';?></td>
                                    <td width="125">
                                        <a class="btn mini green" href="<?php echo base_url('macs/editSend/' . $item->id) ?>"><i class="icon-edit"></i> 编辑</a>
                                        <a class="btn mini green" href="<?php echo base_url('macs/deleteSend/' . $item->id . '?mac_id=' . $item->mac_id) ?>" onclick="return confirm('确定要删除？')"><i class="icon-trash"></i> 删除</a>
                                    </td>
                                </tr>
                                <?php endforeach;?>
                            </tbody>
                        </table>
                        <div class="row-fluid">
                            <div class="dataTables_info">
                                <span>当前第</span><span style="color: red"><?php echo $pg_now?></span>页 
                                <span>共</span><span style="color: red"><?php echo $all_rows?></span>条数据
                                <span>每页显示20条 </span>
                                <?php echo $pg_link;?>
                            </div>
                        </div>
                        <?php else: ?>
                            <div class="alert"><p>未找到数据。<p></div>
                        <?php endif ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->load->view('layout/footer');?>